<extend name="Public/header"/>
<block name="main">
  <body class="f9" >
     <div class="top">
        <div class="backdiv white hg40">
          <img src="__WEBPUBLIC__/Home/img/back1.png" class="backimg">
          <span>我的课程</span>
        </div> 
      </div>
      <div class="pd50">
            <div class="maindiv">
              <volist name="userlist" id="user">
              <div class="weui-flex main">
                
                <div linkto="{:U('Teac/userorder',array('oid'=>$user['id']))}"><div class="placeholder imgbox">
                  <img src="{$user['upic']}" alt="">
                </div></div>
                <div class="weui-flex__item" linkto="{:U('Teac/userorder',array('oid'=>$user['id']))}"><div class="placeholder">
                  <p class="hg80 mgleft">{$user['nick_name']}</p>
                </div></div>
                <if condition="$user['status'] eq 0">
                <div><div class="placeholder modify" oid="{$user['id']}" status="1"><p class="look mgt15" style="padding:0px 10px;">通过</p></div></div>
                <else/>
                <div class="placeholder" oid="{$user['id']}" status="1"><p class="look mgt15" style="padding:0px 10px;">已取消</p></div>
                </if>
              </div>
              </volist>
            </div>
      </div>
  </body>
</block>
<block name="footerjs">
<script>
  $(".modify").on('click',function () {
     var id = $(this).attr("oid");
     var status = $(this).attr("status");
     if (!confirm("您确定要修改吗？")){
      return;
     }
     $.ajax({
        url:"{:U('Teac/cancelorder')}",
        data:{id:id,status:status},
        dataType:"json",
        type:"post",
        success:function ( res ) {
            layer.msg(res.message);
            if (res.flag=="success") {
                location.reload();
            }
        }
    });
  });
</script>
</block>